<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
	body,html{
		margin: 0 auto;
		height:100%;
		width:100%;
		overflow:hidden;
	}
	input{
		border:1px solid #9ABAE9;
		windth:150px;
		height:18px;
	}
	textarea{
		border:1px solid #9ABAE9;
		windth:135px;
		height:50px;
	}
</style>
</head>
<body>
	<div class="divfrist" id="Role_mainDiv" style="width:100%;height:100%;">
						<div style="width:100%;height:0.7%;overflow:hidden;"></div>
						<div style="width:100%;height:98.6%;">
								<div style="width:0.4%;height:100%;float:left;overflow:hidden;"></div>
								<div style="width:99.2%;height:100%;float:left;">
									 <div style="border: 0px solid #9ABAE9;overflow: auto;height:100%;max-height:100%;">
													<!--内容区 -->
											<div style="width:100%;height:100%;">		
													 <table  id="RoleTable" style="border: 0px; width: 100%"></table>
											</div>
											<div id="Role_tb" style="overflow: hidden; padding-left: 10px; padding-top: 5px; border-bottom: 1px solid #9ABAE9;padding-bottom: 5px;">
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon-add',plain:true" onclick="window.Role.addRole()">增加角色</a>||	
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon-edit',plain:true" onclick="window.Role.addRole()">编辑角色</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon-no',plain:true" onclick="window.Role.addRole()">删除角色</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon-ok',plain:true" onclick="window.Role.addRole()">启用角色</a>||
												 <a href="javascript:void(0);" class="easyui-linkbutton"   data-options="iconCls:'icon482',plain:true" onclick="window.Role.addRole()">禁用角色</a>||	    	
											</div>		
													<!--内容区 -->
									 </div>
								</div>
								<div class="width:0.37%;height:100%;float:left;overflow:hidden;"></div>
						</div>
						<div class="width:100%;height:0.6%;overflow:hidden;"></div>
	</div>
</body>
<script type="text/javascript">
(function(){
	//增加角色
	function addRole(){
		
		if($("#Role_addRole").length>0){
			$("#Role_addRole").window("open");
		}
		$('<div id="Role_addRole"></div>').window({
		    title: '增加角色', 		
		    iconCls:'icon-add', 
		    width:getWW().w,   
		    height:getWW().h,   
		    resizable:true,
		    closed: true,   
		    draggable:false,
		    modal: true,
		    content:'aaa',
		    //content:$('<div style="width:100%;height:100%;">aaa</div>').load("${pageContext.request.contextPath}/html/pfl/system/addrole.jsp"),
		    onClose:function(){
				$("#Role_addRole").window("destroy",true);
				
		    }
		});
		$("#Role_addRole").window("open");
		
	}
	//创建角色table
	function createRoleTable(){
			$('#RoleTable').datagrid({
				fit: true,
				toolbar:"#Role_tb",
				singleSelect:false,
				rownumbers: true,
				animate:true,
				striped: true,
				loadMsg:'正在加载数据',
				collapsible:true,
				idField:'sysRole_id',
				fitColumns:true,
				columns:[[
				    {field:'sysRole_id',checkbox:true,width:50},	
			  		{field:'sysRole_name',title:'角色名称',width:120},
			  		{field:'sysRole_state',title:'角色状态',formatter : function(value, row, index){
						if(row.sysRole_state=="0"){
							return  '<font color="red">禁用</font>';
						}
						if(row.sysRole_state=="1"){
							return  '<font color="green">启用</font>';
						}
						return "";
						},width:120},
			  		{field:'sysRole_note',title:'角色描述',width:120},
			  		{field:'sysRole_createDate',title:'创建时间',width:120}
			  		]],
					pagination:true
				});
	}
	//注册所有事件
	window["Role"]={};
	window["Role"]["addRole"]=addRole;
	$(function(){	
		$.parser.parse('#Role_mainDiv'); 
		createRoleTable();
	});
})();

</script>
</html>